﻿<%@ Import Namespace="System.Globalization" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/mainadmin.Master" AutoEventWireup="true"
    CodeBehind="EditGroupMeal.aspx.cs" Inherits="AsiaSnackExpress.EditGroupMeal" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function ConfirmDeleteMeal() {
            return confirm("Do you want to delete the meal?");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td colspan="2">
                <div class="divMealDetailColumn">
                    <div class="divleft">
                        <asp:Label ID="Label4" Font-Bold="true" runat="server" Text='Price of Group '></asp:Label>
                    </div>
                    <div class="divright">
                        <asp:TextBox ID="txtPrice" runat="server" Width="100%"></asp:TextBox>
                        <asp:CompareValidator ID="CompareValidator1" Display="Dynamic" runat="server" ErrorMessage="Please input correct price(number)."
                                        ControlToValidate="txtPrice" Operator="DataTypeCheck" Type="Currency" ValidationGroup="UpdateGroup"></asp:CompareValidator>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="divMealDetailColumn">
                    <div class="divleft">
                        <asp:Label ID="order" Font-Bold="true" runat="server" Text='Name (Germany)  '></asp:Label>
                    </div>
                    <div class="divright">
                        <asp:TextBox ID="txtName" runat="server" Width="100%"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtName" ID="RequiredFieldValidator1"
                            runat="server" ErrorMessage="Please input the Name" Display="Dynamic" ValidationGroup="UpdateGroup"></asp:RequiredFieldValidator>
                    </div>
                </div>
                <div class="divMealDetailColumn">
                    <div class="divleft">
                        <asp:Label ID="Label2" Font-Bold="true" runat="server" Text='Group Extra Meal (Germany)  '></asp:Label>
                    </div>
                    <div class="divright">
                        <asp:TextBox ID="txtDescription" runat="server" Width="100%" TextMode="MultiLine"
                            Rows="6"></asp:TextBox>
                    </div>
                </div>
            </td>
            <td>
                <div class="divMealDetailColumn">
                    <div class="divleft">
                        <asp:Label ID="Label1" Font-Bold="true" runat="server" Text='Name (English)  '></asp:Label>
                    </div>
                    <div class="divright">
                        <asp:TextBox ID="txtNameEnglish" runat="server" Width="100%"></asp:TextBox>
                    </div>
                </div>
                <div class="divMealDetailColumn">
                    <div class="divleft">
                        <asp:Label ID="lblEnglishDescription" Font-Bold="true" runat="server" Text='Group Extra Meal (English)'></asp:Label>
                    </div>
                    <div class="divright">
                        <asp:TextBox ID="txtDescrioptionEnglish" runat="server" Width="100%" TextMode="MultiLine"
                            Rows="6"></asp:TextBox>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="divMealDetailColumn">
                    <div class="divleft">
                        <asp:Label ID="Label3" Font-Bold="true" runat="server" Text='Price Extra Meal '></asp:Label>
                    </div>
                    <div class="divright">
                        <asp:TextBox ID="txtExtraPrice" runat="server" Width="100%"></asp:TextBox>
                        <asp:CompareValidator ID="CompareValidator2" Display="Dynamic" runat="server" ErrorMessage="Please input correct price(number)."
                                        ControlToValidate="txtExtraPrice" Operator="DataTypeCheck" Type="Currency" ValidationGroup="UpdateGroup"></asp:CompareValidator>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center" style="min-height: 60px">
                <asp:Button ID="btnSave" runat="server" Text="Update" OnClick="btnSave_Click" ValidationGroup="UpdateGroup" />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="2" align="left">
                <asp:Label ID="lblMessage" runat="server" ForeColor="Green" Text=""></asp:Label>
            </td>
        </tr>
        <tr valign="top">
            <td colspan="2">
                <div class="listMeals">
                    <asp:GridView ID="gridMeals" runat="server" DataKeyNames="Id" AutoGenerateColumns="False"
                        EmptyDataText="Don't have any Meals in this category." BorderWidth="1px" BackColor="White"
                        CellSpacing="4" CellPadding="4" BorderStyle="Solid" BorderColor="#3366CC" Width="100%"
                        OnRowCommand="gridMeals_RowCommand" OnRowCancelingEdit="gridMeals_RowCancelingEdit"
                        OnRowDeleting="gridMeals_RowDeleting" OnRowEditing="gridMeals_RowEditing" OnRowUpdating="gridMeals_RowUpdating">
                        <FooterStyle ForeColor="#003399" BackColor="#99CCCC"></FooterStyle>
                        <PagerStyle ForeColor="#003399" HorizontalAlign="Left" BackColor="#99CCCC"></PagerStyle>
                        <HeaderStyle ForeColor="#CCCCFF" Font-Bold="True" BackColor="#003399"></HeaderStyle>
                        <Columns>                           
                            <asp:TemplateField HeaderText="Name (Germany)">
                                <ItemTemplate>
                                    <asp:Label runat="server" Text='<%# Bind("Name") %>' ID="lblName"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox Width="94%" ID="txtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorName" Display="Dynamic" runat="server"
                                        ErrorMessage="You must provide a Meal Name." ControlToValidate="txtName">
                            *</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox Width="94%" ID="txtName" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorName" Display="Dynamic" runat="server"
                                        ErrorMessage="You must provide a Order Number." ControlToValidate="txtName" ValidationGroup="ValidateInsert">
                            *</asp:RequiredFieldValidator>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Name (English)">
                                <ItemTemplate>
                                    <asp:Label runat="server" Text='<%# Bind("EnglishName") %>' ID="lblEnglishName"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox Width="94%" ID="txtEnglishName" runat="server" Text='<%# Bind("EnglishName") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox Width="94%" ID="txtEnglishName" runat="server"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Description (Germany)">
                                <ItemTemplate>
                                    <asp:Label runat="server" Text='<%# Bind("Description") %>' ID="lblDescription"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox Width="94%" ID="txtDescription" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox Width="94%" ID="txtDescription" runat="server"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Description (English)">
                                <ItemTemplate>
                                    <asp:Label runat="server" Text='<%# Bind("EnglishDescription") %>' ID="lblEnglishDescription"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox Width="94%" ID="txtEnglishDescription" runat="server" Text='<%# Bind("EnglishDescription") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox Width="94%" ID="txtEnglishDescription" runat="server"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="HighLight (Germany)">
                                <ItemTemplate>
                                    <asp:Label runat="server" Text='<%# Bind("HighLight") %>' ID="lblHighLight"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox Width="94%" ID="txtHighLight" runat="server" Text='<%# Bind("HighLight") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox Width="94%" ID="txtHighLight" runat="server"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="HighLight (English)">
                                <ItemTemplate>
                                    <asp:Label runat="server" Text='<%# Bind("EnglishHighLight") %>' ID="lblEnglishHighLight"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox Width="94%" ID="txtEnglishHighLight" runat="server" Text='<%# Bind("EnglishHighLight") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox Width="94%" ID="txtEnglishHighLight" runat="server"></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>
                            <%--  <asp:CommandField ShowEditButton="true" ShowCancelButton="true" ShowDeleteButton="true">
                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                            </asp:CommandField>--%>
                            <asp:TemplateField>
                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnedit" runat="server" CommandName="Edit" Text="Edit" />
                                    &nbsp
                                    <asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete" Text="Delete"
                                        OnClientClick="return ConfirmDeleteMeal()" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:LinkButton ID="btnupdate" runat="server" CommandName="Update" Text="Save" ValidationGroup="UpdateHistory" />&nbsp
                                    <asp:LinkButton ID="btncancel" runat="server" CommandName="Cancel" Text="Cancel" />
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:LinkButton ID="btnInsert" runat="Server" CommandName="Insert" Text="Save" UseSubmitBehavior="False"
                                        ValidationGroup="ValidateInsert" />&nbsp
                                    <asp:LinkButton ID="btnCancelInsert" runat="Server" Text="Cancel" CommandName="Cancel"
                                        UseSubmitBehavior="False" />
                                </FooterTemplate>
                                <FooterStyle ForeColor="#003399" HorizontalAlign="Right" />
                            </asp:TemplateField>
                        </Columns>
                        <SelectedRowStyle ForeColor="#CCFF99" Font-Bold="True" BackColor="#009999"></SelectedRowStyle>
                        <AlternatingRowStyle BackColor="Control" />
                        <RowStyle ForeColor="#003399" BackColor="White"></RowStyle>
                    </asp:GridView>
                </div>
                <div>
                    <asp:Button ID="btnAddMore" CssClass="button" runat="server" Text="Add a new Meal"
                        OnClick="btnAddMore_Click" /></div>
            </td>
        </tr>
    </table>
</asp:Content>
